package com.jh.netty.client;

import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;

import java.util.Arrays;

public class Main {
    public static void main(String[] args) {
//        ByteBuf buffer= Unpooled.buffer(24);
//        buffer.writeInt(31);
//        buffer.writeInt(43);

        int v = 1023;
        byte[] b = new byte[4];
        b[0] = (byte) ((v >>> 24) & 0xFF);
        b[1] = (byte) ((v >>> 16) & 0xFF);
        b[2] = (byte) ((v >>> 8) & 0xFF);
        b[3] = (byte) ((v >>> 0) & 0xFF);

        System.out.println(Arrays.toString(b));

        // out.write((v >>> 24) & 0xFF);
        //        out.write((v >>> 16) & 0xFF);
        //        out.write((v >>>  8) & 0xFF);
        //        out.write((v >>>  0) & 0xFF);

//        Integer.getInteger("1").by
//        buffer.writeByte(1);
//        buffer.writeByte(2);
//        buffer.writeByte(3);
//        buffer.writeByte(4);
//        buffer.writeInt(12);
//        buffer.writeChar(13);
//        buffer.writeLong(12);
//        System.out.println(buffer.getUnsignedInt(0));
//        System.out.println(buffer.getUnsignedInt(4));
    }
}